﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GrayParrot.Configuration
{
    public class ConfigurationSectionBase<T> : ConfigurationSection
        where T : class, new()
    {
        public static T GetConfiguration(string sectionName)
        {
            T configuration = ConfigurationManager.GetSection(sectionName) as T;

            if (configuration != null)
                return configuration;

            return new T();
        }
    }
}
